import 'package:flutter/material.dart';
import 'package:card_swiper/card_swiper.dart';

class MySwiper extends StatelessWidget {
  MySwiper({Key? key, required this.imgList}) : super(key: key);
  List<String> imgList = [];
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Swiper(
        itemBuilder: (BuildContext context, int index) {
          return Card(
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadiusDirectional.circular(10),
            ),
            clipBehavior: Clip.antiAlias,
            child: Image.network(
              imgList[index],
              fit: BoxFit.cover,
            ),
          );
        },
        itemCount: imgList.length,
        // pagination: SwiperPagination(),
        // control: SwiperControl(),
        loop: true,
        autoplay: true,
      ),
      height: 120,
    );
  }
}
